import React from 'react';
import { Carousel as AntdCarousel } from 'antd';
import type { CarouselProps as AntdCarouselProps } from 'antd';
import { createStyles } from 'antd-style';

export interface CarouselProps extends AntdCarouselProps {
  /**
   * @description 自定义样式类名
   */
  customClassName?: string;
}

const useStyles = createStyles(({ token, css }) => ({
  carousel: css`
    border-radius: ${token.borderRadius}px;
  `,
}));

const Carousel: React.FC<CarouselProps> = ({ customClassName, className, ...restProps }) => {
  const { styles, cx } = useStyles();
  
  const carouselClassName = cx(
    className,
    customClassName,
    styles.carousel
  );

  return <AntdCarousel className={carouselClassName} {...restProps} />;
};

export { Carousel };
export default Carousel;

